package com.note.app.document;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;

import java.time.LocalDateTime;

/**
 * 协作操作内容文档
 */
@Data
@Document(collection = "collaboration_operation_content")
@Schema(description = "协作操作内容")
public class CollaborationOperationContent {
    
    @Id
    @Schema(description = "MongoDB ID")
    private String id;
    
    @Schema(description = "会话ID")
    private Long sessionId;
    
    @Schema(description = "操作用户ID")
    private Long userId;
    
    @Schema(description = "版本号")
    private Integer version;
    
    @Schema(description = "操作类型：0-插入，1-删除，2-替换，3-格式化")
    private Integer opType;
    
    @Schema(description = "操作位置", example = "{\"index\":10}")
    private String position;
    
    @Schema(description = "操作内容", example = "{\"text\":\"Hello\",\"format\":{\"bold\":true}}")
    private String content;
    
    @Schema(description = "完整文档内容的快照（仅在关键版本保存）")
    private String documentSnapshot;
    
    @Schema(description = "创建时间")
    private LocalDateTime createdAt;
} 